<template>
  <div>
    <h3>订单模块</h3>
    <template>
      <el-table :data="tableData" stripe style="width: 100%">
        <el-table-column prop="id" label="订单编号" width="180">
        </el-table-column>
        <el-table-column prop="file" label="文件名" width="120">
        </el-table-column>
        <el-table-column prop="creatAt" label="创建日期"> </el-table-column>
        <el-table-column prop="status" :formatter="formatterColumn" label="订单状态"> </el-table-column>
        <el-table-column prop="" label="操作">
          <el-button type="danger" icon="el-icon-delete" circle></el-button>
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>

<script>
import { FindOrder } from "../api/order";

export default {
  data() {
    return {
      tableData: 
        [{
        },]
     
      
    };
  },
  mounted() {
    this.Find();
  },
  methods: {
    Find() {
      FindOrder(localStorage.getItem("uphone")).then((res) => {
        if (res.data.code == 200) {
          //this.list = res.data;
          console.log(res);
          this.tableData = res.data.data;
          console.log(this.tableData);
        }
      });
    },
    formatterColumn(row, column) {
      switch (row.status) {
        case 0:
          return "待付款";
          break;
        case 1:
          return "已支付";
          break;
        case 2:
          return "已打印";
          break;
        case 3:
          return "已完成";
          break;
        case 4:
          return "已取消";
          break;
        case 5:
          return "售后中";
          break;
        case 6:
          return "售后完成";
          break;
        default:
          return row.IsAudit;
      }
    },
  },
  
};
</script>

<style scoped>
</style>